﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BusinessLibrary.DAL;

namespace BusinessLibrary.BLL
{
    public class Classe
    {
        # region var
        public int Id { get; set; }
        public string Nom { get; set; }
        public Niveau niveau { get; set; }

        #endregion
        #region methodes
        /// <summary>
        /// 
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static Classe GetClasseById(int id)
        {
            return sqlClasse.GetClasseById(id);
        }


        public static int deleteClasse(int id, int id_niveau)
        {
            return sqlClasse.deletClasse(id, id_niveau);
        }


        public static int SaveClasse(Classe c)
        {
            int nbRow;
            if ((nbRow = sqlClasse.updateClasse(c)) > 0)
                return nbRow;
            else
                return sqlClasse.insertClasse(c);
        }

        public static List<Classe> GetListeListeClasse()
        {
            return sqlClasse.SelectListeClasse();
        }
        #endregion
    }
}
